#!/usr/bin/python

import sys
import Image
from coverdetect import coverdetect
from perspective_correction import perspective_correction

if __name__ == '__main__':
    ul, ll, lr, ur = coverdetect(sys.argv[1])
    im = perspective_correction(Image.open(sys.argv[1]), ul, ll, lr, ur)
    im.save(file('output.jpg', 'wb'))
    
